// ==========================================================================
// gin-sns 自动生成model扩展代码列表、增、删，改、查、导出，只生成一次，按需修改,再次生成不会覆盖.
// date：2021-02-02 11:00:55 +0800 CST
// path: app/model/module/video/video.go
// author：jon
// ==========================================================================
package video

import (
	"time"
)

// 数据表映射结构体
type Entity struct {
	Id              int64     `json:"id" xorm:"not null pk autoincr comment('') bigint(20)"`
	BlogId          int64     `json:"blog_id" xorm:"comment('博客id') bigint(20)"`
	UserId          int64     `json:"user_id" xorm:"comment('用户id') bigint(20)"`
	Title           string    `json:"title" xorm:"comment('标题') varchar(255)"`
	Description     string    `json:"description" xorm:"comment('描述') varchar(1024)"`
	Logo            string    `json:"logo" xorm:"comment('封面logo') varchar(255)"`
	Mp4hdUrl        string    `json:"mp4Hd_url" xorm:"comment('MP4HD URL') varchar(255)"`
	Mp4Url          string    `json:"mp4_url" xorm:"comment('MP4 URL') varchar(255)"`
	M3u8hdUrl       string    `json:"m3u8Hd_url" xorm:"comment('M3U8HD URL') varchar(255)"`
	Vid             string    `json:"vid" xorm:"comment('视频id') varchar(255)"`
	M3u8Url         string    `json:"m3u8_url" xorm:"comment('M3U8 URL') varchar(255)"`
	Length          int       `json:"length" xorm:"comment('文件长度') int(11)"`
	Ptime           time.Time `json:"ptime" xorm:"comment('播放时间') datetime"`
	CountPlay       int64     `json:"count_play" xorm:"comment('播放次数') bigint(20)"`
	CountComment    int64     `json:"count_comment" xorm:"comment('评论次数') bigint(20)"`
	CountLike       int64     `json:"count_like" xorm:"comment('赞同次数') bigint(20)"`
	CountFavor      int64     `json:"count_favor" xorm:"comment('收藏次数') bigint(20)"`
	CountReward     int64     `json:"count_reward" xorm:"comment('打赏次数') bigint(20)"`
	Status          int       `json:"status" xorm:"comment('0未审核 1正常状态 2审核未通过 3删除') tinyint(2)"`
	CreateTime      time.Time `json:"create_time" xorm:"comment('创建时间') datetime"`
	UpdateTime      time.Time `json:"update_time" xorm:"comment('更新时间') datetime"`
	LastCommentTime time.Time `json:"last_comment_time" xorm:"comment('最后评论时间') datetime"`
}

//新增页面请求参数
type AddReq struct {
	BlogId       int64     `form:"blogId" `
	UserId       int64     `form:"userId" `
	Title        string    `form:"title" `
	Description  string    `form:"description" `
	Logo         string    `form:"logo" `
	Mp4hdUrl     string    `form:"mp4hdUrl" `
	Mp4Url       string    `form:"mp4Url" `
	M3u8hdUrl    string    `form:"m3u8hdUrl" `
	Vid          string    `form:"vid" `
	M3u8Url      string    `form:"m3u8Url" `
	Length       int       `form:"length" `
	Ptime        time.Time `form:"ptime" `
	CountPlay    int64     `form:"countPlay" `
	CountComment int64     `form:"countComment" `
	CountLike    int64     `form:"countLike" `
	CountFavor   int64     `form:"countFavor" `
	CountReward  int64     `form:"countReward" `
	Status       int       `form:"status" binding:"required"`
}

//修改页面请求参数
type EditReq struct {
	Id           int64     `form:"id" binding:"required"`
	BlogId       int64     `form:"blogId" `
	UserId       int64     `form:"userId" `
	Title        string    `form:"title" `
	Description  string    `form:"description" `
	Logo         string    `form:"logo" `
	Mp4hdUrl     string    `form:"mp4hdUrl" `
	Mp4Url       string    `form:"mp4Url" `
	M3u8hdUrl    string    `form:"m3u8hdUrl" `
	Vid          string    `form:"vid" `
	M3u8Url      string    `form:"m3u8Url" `
	Length       int       `form:"length" `
	Ptime        time.Time `form:"ptime" `
	CountPlay    int64     `form:"countPlay" `
	CountComment int64     `form:"countComment" `
	CountLike    int64     `form:"countLike" `
	CountFavor   int64     `form:"countFavor" `
	CountReward  int64     `form:"countReward" `
	Status       int       `form:"status" binding:"required不能为空"`
}

//分页请求参数
type SelectPageReq struct {
	BlogId       int64     `form:"blogId"`       //博客id
	UserId       int64     `form:"userId"`       //用户id
	Title        string    `form:"title"`        //标题
	Description  string    `form:"description"`  //描述
	Logo         string    `form:"logo"`         //封面logo
	Mp4hdUrl     string    `form:"mp4hdUrl"`     //MP4HD URL
	Mp4Url       string    `form:"mp4Url"`       //MP4 URL
	M3u8hdUrl    string    `form:"m3u8hdUrl"`    //M3U8HD URL
	Vid          string    `form:"vid"`          //视频id
	M3u8Url      string    `form:"m3u8Url"`      //M3U8 URL
	Length       int64     `form:"length"`       //文件长度
	Ptime        time.Time `form:"ptime"`        //播放时间
	CountPlay    int64     `form:"countPlay"`    //播放次数
	CountComment int64     `form:"countComment"` //评论次数
	CountLike    int64     `form:"countLike"`    //赞同次数
	CountFavor   int64     `form:"countFavor"`   //收藏次数
	CountReward  int64     `form:"countReward"`  //打赏次数
	Status       int       `form:"status"`       //0未审核 1正常状态 2审核未通过 3删除
	BeginTime    string    `form:"beginTime"`    //开始时间
	EndTime      string    `form:"endTime"`      //结束时间
	PageNum      int       `form:"pageNum"`      //当前页码
	PageSize     int       `form:"pageSize"`     //每页数
}
